const app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    img:''
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var level = options.id
    var that = this

    wx.getStorage({
      key: 'openid',
      success: function(res) {
        let openid = res.data

        wx.request({
          url: app.globalData.URL + '/app/personalCode/code?openid=' + openid + '&level=' + level,
          success: function (res) {
            console.log(res)
            that.setData({
              img: res.data.imgUrl
            })
          }
          
        })
      },
      
    })
    
  },

 

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },


 
})